package com.smbms.service.impl;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.smbms.pojo.User;
import com.smbms.repository.UserRepository;
import com.smbms.service.UserService;
@Service
public class UserServiceImpl implements UserService{
	private Logger logger =Logger.getLogger(UserServiceImpl.class);
	@Autowired
	private UserRepository userRepository;
	@Override
	public User getLoginUser(String userCode, String userPassword) {
		logger.info("==>验证用户是否存在");
		User loginUser=userRepository.getLoginUser(userCode);
		if(loginUser!=null){
			if(loginUser.getUserPassword().equals(userPassword)){
				return loginUser;
			}
		}
		return null;
	}

}
